import { createRouter, createWebHashHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
    redirect: "/index",
    children: [
      {
        path: 'index',
        name: 'Index',
        component: () => import(/* webpackChunkName: "about" */ '../views/home/index.vue')
      },
      {
        path: 'cate',
        name: 'Cate',
        component: () => import(/* webpackChunkName: "about" */ '../views/home/cate.vue')
      },
      {
        path: 'cart',
        name: 'Cart',
        component: () => import(/* webpackChunkName: "about" */ '../views/home/cart.vue')
      },
      {
        path: 'user',
        name: 'User',
        component: () => import(/* webpackChunkName: "about" */ '../views/home/user.vue')
      }
    ]
  },
  {
    path: "/goods",
    name: "Goods",
    component: () => import('../views/goods.vue')
  },
  {
    path: "/detail/:id",
    name: "Detail",
    component: () => import('../views/detail.vue')
  },
  {
    path: "/login",
    name: "Login",
    component: () => import('../views/login.vue')
  }


]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
